<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="keywords" content="github加速,代理加速下载,github代理,github镜像站,github免费加速下载"/>
    <meta name="description"
          content="解决因为网络环境问题github下载文件慢的问题，网站由个人开发者维护，为有需要的小伙伴提供一个应急解决方案，可以通过github加速站点访问浏览github网站的内容（不能登录）"/>
    <title>github免费加速下载|github镜像加速|代理下载加速</title>
    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport">
    <meta name="baidu-site-verification" content="codeva-whKMaMINKl" />
    <style>
        body {

        }

        #downUrl {
            display: none;
        }

        #downUrl {
            float: right;
        }

        #downList td {
            padding: 5px;
        }

        #downList th {
            padding: 5px;
        }

        #downList {
            width: 100%;

        }

        #black {
            background: white;
            width: 100vw;
            height: 100vh;
            position: absolute;
            z-index: 999;
        }

        #mydiv {
            position: relative;
        }


        .container {
            position: absolute;
            top: 0;
            z-index: 888;
            min-height: 100vh;
        }

        .space {
            display: flex;
            flex-direction: row;
            justify-content: center;
        }

        #submit {
            width: 100%;
        }

        #copyright {
            width: 100%;
            text-align: center;
            font-weight: bold;
            text-decoration: underline;
            font-family: auto;
        }


    </style>
</head>


<body id="mydiv">

<div id="black">
    <h1>loading</h1>
</div>

<!--模态框-->
<div class="modal fade" id="qrcode" tabindex="-1" role="dialog" aria-labelledby="information" data-backdrop="static">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">
                    <span>×</span>
                </button>
                <h4 class="modal-title">正在为您下载</h4>
            </div>
            <div class="modal-body" style="text-align: center">
                <p id="message">请稍等,请勿刷新页面</p>
                <p id="process"></p>
            </div>
        </div>
    </div>
</div>

<!--弹出登陆表单-->
<div class="modal fade" id="login" tabindex="-1" role="dialog" aria-labelledby="information" data-backdrop="static">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">
                    <span>×</span>
                </button>
                <h4 class="modal-title">欢迎登陆</h4>
            </div>
            <div>


                <div class="modal-body">

                    <div class="input-group">
                        <span class="input-group-addon">用户名</span>
                        <input id="Aname" name="Aname" type="text" class="form-control" placeholder="username"
                               aria-describedby="sizing-addon2">
                        <span class="input-group-addon">密　码</span>
                        <input id="Apwd" name="Apwd" type="password" class="form-control" placeholder="password"
                               aria-describedby="sizing-addon2">
                    </div>
                    <div style="display: flex;flex-direction: column;align-items: flex-end;">
                        <button id="loginSubmit" class="btn btn-default navbar-btn">登陆</button>
                    </div>

                </div>

            </div>
        </div>
    </div>
</div>


<div class="space">
    <div class="planet">
        <div class="planet_shadow"></div>
        <div class="crater1"></div>
        <div class="crater2"></div>
        <div class="crater3"></div>
        <div class="crater4"></div>
    </div>
    <div class="stars">
        <div class="star"></div>
        <div class="star pink"></div>
        <div class="star blue"></div>
        <div class="star yellow"></div>
        <div class="star green"></div>
    </div>


    <div class="container">

        <div class="row">
            <div class="col-sm-12 col-lg-8 col-md-8" style="padding-bottom: 50px;">
                <nav class="navbar navbar-default">
                    <div class="container-fluid">
                        <!-- Brand and toggle get grouped for better mobile display -->
                        <div class="navbar-header">
                            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                                    data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                                <span class="sr-only">Toggle navigation</span>
                                <span class="icon-bar"></span>
                                <span class="icon-bar"></span>
                                <span class="icon-bar"></span>
                            </button>
                            <a class="navbar-brand" href="#">SALLAI</a>
                        </div>

                        <!-- Collect the nav links, forms, and other content for toggling -->
                        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">

                            <button id="loginBtn" type="button" class="btn btn-default navbar-btn navbar-right">管理登陆
                            </button>

                        </div><!-- /.navbar-collapse -->
                    </div><!-- /.container-fluid -->
                </nav>


                <h2>github 文件下载助手</h2>
                <p id="res"></p>
                <p>示例链接: https://github.com/sallai1/sallai/archive/master.zip</p>
                <span><a href="https://github.com" target="_blank">前往官方github地址</a></span>
                <p></p>
                <p><a href="/github" target="_blank">前往github加速地址</a></p>
                <hr style="border-top: 3px solid #eee;"/>
                <form action="/download11" method="post">

                    <div class="form-group">
                        <label>下载地址</label>
                        <input type="text" class="form-control" id="url" name="url" placeholder="输入github下载地址">
                    </div>
                    <div class="input-group" style="display: flex;width: 100%">
                        <img src="/img" onClick="this.src='/img?' + new Date().getTime();" style="float: left">
                        <input type="text" style="float: left;width: 200px" class="form-control" id="verityCode"
                               name="verityCode" placeholder="验证码">
                    </div>
                    <button type="button" class="btn btn-default" id="submit" style="margin-top: 10px">提交</button>
                    <a id="downUrl" class="btn btn-default" href="#" role="button">点我下载</a>
                </form>
            </div>


            <div class="col-sm-12 col-lg-4 col-md-4">
                <table id="downList" style="word-wrap:normal;" border="1">
                    <tr>
                        <th>文件名</th>
                        <th>时间</th>
                        <th>操作</th>
                    </tr>
                </table>
            </div>

            <div class="col-sm-12 col-lg-4 col-md-4"
                 style="display: flex;flex-direction: row;justify-content: flex-end">
                <img th:src="@{/static/img/wx.jpg}" alt="公众号二维码">
            </div>
        </div>
        <p id="copyright">author:sallai &nbsp email:sallai@aliyun.com</p>
    </div>


</div>

<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script th:src="@{static/bootstrap/js/bootstrap.js}"></script>
<link type="text/css" rel="stylesheet" th:href="@{static/bootstrap/css/bootstrap.css}"></link>

<script th:src="@{static/index/js/index.js}"></script>
<!--指针效果-->
<script type="text/javascript" th:src="@{static/js/canvas-particle.js}"></script>
<script type="text/javascript">
    const hostname = window.location.hostname;

    console.log("current hostname is " + hostname);

    window.onload = function () {

        $('#black').hide();
        //配置
        var config = {
            vx: 4,	//小球x轴速度,正为右，负为左
            vy: 4,	//小球y轴速度
            height: 2,	//小球高宽，其实为正方形，所以不宜太大
            width: 2,
            count: 50,		//点个数
            color: "0, 128, 0", 	//点颜色
            stroke: "130,255,255", 		//线条颜色
            dist: 6000, 	//点吸附距离
            e_dist: 20000, 	//鼠标吸附加速距离
            max_conn: 10 	//点到点最大连接数
        }
        updateDownloadList();

        //调用
        CanvasParticle(config);
        //获取历史卸载列表
        var item = sessionStorage.getItem("downHistory");
        if (item != null) {
            var parse = JSON.parse(item);
            console.log(parse);
        }
        // setDownHistoroy();

    }

    function updateDownloadList() {
        var downHistory = getDownHistory();
        if (downHistory != null) {
            var parse1 = JSON.parse(downHistory);
            for (var i in parse1) {
                var item = parse1[i];
                $("#downList").append(`<tr>
                                      <td>` + item.fileName + `</td>
                                      <td>` + item.time + `</td>
                                      <td><a href="` + item.url + `" target="_blank">下载</a></td>
                                   </tr>`)
            }
        }
    }

    $("#url").change(function () {
        var text = $(this).val();
        if (text.indexOf(hostname) != -1) {
            text = text.replaceAll(hostname + "/github", "github.com");
            console.log(text);
        }
        $(this).val(text);
    });
</script>


</body>
</html>